-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first version of tests for expected RDF #32
Conversation
now tests expect latest version of spec currently at gh-pages, i still need to fix then to fail properly... also will switch to turtle soon for expected RDF |
var getExample = function(name) { | ||
if (!examples[name]) { | ||
examples[name] = JSON.parse(doc('#' + name + ' pre.example').text()); | ||
examples[name]['@context'] = CONTEXT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of modifying the examples, it would be better to inject the context as expandContext
option in the toRDF
call. If you do it this way and a context already exists in the example, you'll overwrite it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lanthaler thx! changed in 6f8c84d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @elf-pavlik Would be interessting to check whether we can also leverage this to convert the examples in the Hydra spec to Turtle.
fixed! i think i tired it that way since JSON-LD Playground gives me bunch of triples from OWL definitions if i just paste context there. anyways looks fine here :) |
thanks to @bergos work on rdf-interfaces and rdf-ext we have clean way to compare examples in JSON-LD with expected RDF in Turtle fixtures! tests run and pass after merging on master branch! i still can tidy up code with some re factoring and add tests for more examples |
I'll make new PR which automatically compares JSON-LD, RDFa and Turtle from examples. |
it addresses #17
not fully ready to merge but i would like to get some feedback, and discuss travis-ci integration
you can test it by running from root of the repository
$ npm install $ npm test
i could also setup separate repository and run those tests independently!